//========encoding:utf-8=========
/*
 * @describe:  三目运算符
 * @author:mhao
 * @copyright:chinasoft.cn
 * @date:2020年3月24日   下午10:11:46
 */
package edu.chinasoft.service;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.chinasoft.domain.Employee;
import edu.chinasoft.mapper.EmployeeMapper;

public class EmployeeServiceImp implements EmployeeService{
	private Logger logger = LoggerFactory.getLogger(EmployeeServiceImp.class);
	private EmployeeMapper employeeMapper;
	@Override
	public void addEmployee(Employee employee) {
		// TODO Auto-generated method stub
		logger.info("EmployeeServiceImp>>>addEmployee start ……");
		this.employeeMapper.insertTable(employee);
		logger.info("EmployeeServiceImp>>>addEmployee end ……");
		
	}

	@Override
	public void upDateEmployee(Employee employee) {
		// TODO Auto-generated method stub
		logger.info("EmployeeServiceImp>>>upDateEmployee start ……");
		this.employeeMapper.updateTable(employee);
		logger.info("EmployeeServiceImp>>>upDateEmployee end ……");
		
	}

	@Override
	public void deleteEmployee(Employee employee) {
		// TODO Auto-generated method stub
		logger.info("EmployeeServiceImp>>>deleteEmployee start ……");
		this.employeeMapper.deleteTableById(employee);
		logger.info("EmployeeServiceImp>>>deleteEmployee end ……");
	}

	@Override
	public List<Employee> queryEmployee() {
		// TODO Auto-generated method stub
		logger.info("EmployeeServiceImp>>>queryEmployee start ……");
		List<Employee> result = this.employeeMapper.selectTable();
		logger.info("EmployeeServiceImp>>>queryEmployee end ……");
		return result;
	}

	public EmployeeMapper getEmployeeMapper() {
		return employeeMapper;
	}

	public void setEmployeeMapper(EmployeeMapper employeeMapper) {
		this.employeeMapper = employeeMapper;
	}
	

}
